package com.zhz.service.impl;

import com.zhz.dao.OrderRepository;
import com.zhz.pojo.Order;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.persistence.Transient;

@Service
public class OrderServiceImpl {

    @Resource
    private OrderRepository repository;

    @Transient
    public int save(Order order) {
        return repository.save(order) == null ? 0 : 1;
    }

    public Order findOrderNO(String orderNo) {
        return repository.findByOrderNo(orderNo);
    }
}
